<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img {
            position: absolute;
            top: 0px;
            width: 30px;
            height: 30px;
            transform: translate(-50%,-40%);
        }
    </style>
</head>

<body>
    <img src="/pink/imgs/zyz_txt/狗.png" alt="">
    <script>
        var im = document.querySelector('img')
        document.addEventListener('mousemove', function (e) {
            let x = e.pageX
            let y = e.pageY
            console.log(x, y);
            im.style.left=x+'px'
            im.style.top=y+'px'
        })
    </script>
</body>

</html>